'''
@Company: TWL
@Author: xue jian
@Email: xuejian@kanzhun.com
@Date: 2020-07-13 17:03:07
'''

#!/usr/bin/env python
import pika



class WritePika:
    def __init__(self):
        import redis
        self.r = redis.Redis(host = "172.18.4.2", port=9222)

        
    def write_file(self, path, model_name):
        f = open(path, 'r')
        lines = f.readlines()
        tmp_m = {}
        for line in lines:
            line = line.split('\t')
            tmp_m[line[0]] = line[1]
        
        self.r.hmset(model_name, tmp_m)
        # print(r.hget('word_bag_feature', 'redis_tcmcp'))
        


    